from django.test import TestCase

from ..forms import UserLoginForm, ChangeProfileForm, UserRegisterForm


class AddTaskFormTest(TestCase):

    def test_user_login_form_username_field_label(self):
        form = UserLoginForm()
        self.assertTrue(form.fields['username'].label is None or form.fields['username'].label == 'email')

    def test_change_profile_form_fields_max_length(self):
        form = ChangeProfileForm()
        self.assertEqual(form.fields['city'].max_length, 60)
        self.assertEqual(form.fields['display_name'].max_length, 50)
        self.assertEqual(form.fields['country'].max_length, 50)
        self.assertEqual(form.fields['about'].max_length, 250)

    def test_user_register_form_email_field_label(self):
        form = UserRegisterForm()
        field_label = form.fields['email'].label
        self.assertEqual(field_label, 'Email')